package com.example.demo.controller;

import com.example.demo.model.CuitUser;
import com.example.demo.properties.AuthorProperties;
import com.example.demo.repository.CuitUserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author sunshixiong
 * @date 2017/12/1 14:00
 */
@RestController
@RequestMapping(value = "/cuit")
public class CuitUserController {

    @Autowired
    private CuitUserRepository cuitUserRepository;
    @Autowired
    private AuthorProperties authorProperties;

    @GetMapping(value = "/listCuitUser")
    public List<CuitUser> listCuitUser(){

        return cuitUserRepository.findAll();
    }
    @PostMapping(value = "/cuitUserAdd")
    public CuitUser cuitUserAdd(CuitUser cuitUser){

        System.out.print(cuitUser);
        return cuitUserRepository.save(cuitUser);
    }

}
